import axios from '../../../plugins/axios'
import { CatalogActionsEnum } from '../../../_/vue/store/catalog'
export default {
  [CatalogActionsEnum.LIST] ({ commit }, params) {
    return axios.get('/catalog', { params })
  },
  [CatalogActionsEnum.EDIT] ({ commit }, id) {
    return axios.get(`/catalog/${id}`)
  },
  [CatalogActionsEnum.SAVE] ({ commit }, payload) {
    return axios.post(`/catalog/${payload.id}`, payload.data)
  },
  [CatalogActionsEnum.STORE] ({ commit }, data) {
    return axios.post('/catalog', data)
  },
  [CatalogActionsEnum.DELETE] ({ commit }, ids) {
    return axios.delete('/catalog', { data: ids })
  }
}
